#pragma once
#include "afxwin.h"
#include "afxcmn.h"
#include "GroupListBox.h"
#include "OXStatic.h"
#include "OXLayoutManager.h"
#include "IsiLcdLib\IsiLcdDisplay.h"
#include "OXRoundedButton.h"
#include "RoundStatic.h"
#include "MeasureItem.h"


// CMeasureDlg dialog

class CMeasureDlg : public CDialogEx
{
	DECLARE_DYNAMIC(CMeasureDlg)

public:
	CMeasureDlg(CWnd* pParent = NULL);   // standard constructor
	virtual ~CMeasureDlg();

// Dialog Data
	enum { IDD = IDD_MEASURE };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()

public:
  void Reset(void);
  void Count(void);
  void SetNgOk(bool Ok);
  void SetItemValue(int Index, const tstring& ValueStr, bool Ok);

private:
  void InitValueList(void);
  void UpdateDispIndex(void);

public:
  void SolutionChanged_slot(void);
  void ProjectChanged_slot(void);
  void ItemAdded_slot(CMeasureItem *i);
  void ItemDeleting_slot(CMeasureItem *i);
  void ItemDeleted_slot(void);
  void ItemNameChanging_slot(CMeasureItem *i, const tstring& newName);

public:
  afx_msg void OnOk();
  afx_msg void OnCancel();
  virtual BOOL OnInitDialog();
  afx_msg void OnDestroy();
  afx_msg void OnSize(UINT nType, int cx, int cy);
  afx_msg void OnMeasure();
  afx_msg void OnItemDblclk();
  afx_msg void OnItemSelChange();
  afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);

public:
  CGroupListBox     WndValList;
  COXStatic         WndOkNg;

private:
  CIsiLcdDisplay    wnd_count_;
  COXLayoutManager  layout_manager_;
  CStatic wnd_logo_;
  COXRoundedButton wnd_measure_;
};
